import service from "../utils/request";

// 登录
export const Login = (parameter: any) => {
  return service({
    url: "/login",
    method: "post",
    data: parameter,
  });
};

// 获取菜单列表
export const getMenuList = () => {
  return service({
    url: "/auth-menu/list",
    method: "get",
  });
};

// 获取当前登录用户信息
export const getCurUser = () => {
  return service({
    url: "/auth-admin/curUser",
    method: "get",
  });
};

// 查询当前用户的菜单权限
export const getCurUserMenu = () => {
  return service({
    url: "/auth-role/find/cur/user/menu",
    method: "get",
  });
};

// 获取所有数据字典
export const getAllDic = () => {
  return service({
    url: "/api/util/getAllDic",
    method: "post",
  });
};

///////////////////// 代理商管理 //////////////////////////////////
// 获取代理商列表（所有代理）
export const getProxyList = (parameter: any) => {
  return service({
    url: "/agent/list",
    method: "post",
    data: parameter,
  });
};

// 添加一级代理
export const addAgent = (parameter: any) => {
  return service({
    url: "/agent/add",
    method: "post",
    data: parameter,
  });
};

// 修改一级代理
export const editAgent = (parameter: any) => {
  return service({
    url: "/agent/edit",
    method: "post",
    data: parameter,
  });
};

// 禁用一级代理
export const disableAgentApi = (parameter: any) => {
  return service({
    url: `/agent/disable/${parameter.state}`,
    method: "post",
    data: parameter.ids,
  });
};

// 重置密码
export const resetPass = (agent_id: any) => {
  return service({
    url: `/agent/reset/password/${agent_id}`,
    method: "post",
  });
};
// 获取一级代理绑定的vip套餐
export const findAgentPacksApi = (parameter: any) => {
  return service({
    url: "/agent/find/agent/packs",
    method: "post",
    data: parameter,
  });
};

// 查询一级代理Excel数据
export const findAgentExcelApi = (parameter: any) => {
  return service({
    url: `/agent/agent/export`,
    method: "post",
    responseType: "blob",
    data: parameter,
  });
};

// 解除一级代理和vip套餐的绑定
export const relieveApi = (parameter: any) => {
  return service({
    url: `/agent/relieve/${parameter.agent_id}/${parameter.pack_id}`,
    method: "post",
  });
};

// 获取用户列表
export const findUserApi = (parameter: any) => {
  return service({
    url: "/user/find",
    method: "post",
    data: parameter,
  });
};

// 根据id查询vip套餐列表
export const findPackVipByIdApi = (parameter: any) => {
  return service({
    url: `/pack-vip/find/byId/${parameter.packId}`,
    method: "get",
  });
};

// 配置一级代理的会员套餐
export const setAgentPacks = (parameter: any) => {
  return service({
    url: `/agent/set/packs/${parameter.agent_id}`,
    method: "post",
    data: parameter.packIds,
  });
};

// 根据员工id提取员工数据
export const findStaffByIdApi = (id) => {
  return service({
    url: `/auth-admin/getById/${id}`,
    method: "get",
  });
};

// 配置代理销售代表及销售总监
export const setAgentSaleApi = (parameter: any) => {
  return service({
    url: "/agent/set/agent/sale",
    method: "post",
    data: parameter,
  });
};

// 获取登陆地信息
export const findAuditInfoApi = (parameter: any) => {
  return service({
    url: "/agent/queryAuditInfo",
    method: "post",
    data: parameter,
  });
};

// 保存中视url
export const updateUrlApi = (parameter: any) => {
  return service({
    url: "/agent/updateUrl",
    method: "post",
    data: parameter,
  });
};

///////////////////// 员工管理 //////////////////////////////////
// 添加员工账号
export const addEmployeeApi = (parameter: any) => {
  return service({
    url: "/auth-admin/add",
    method: "post",
    data: parameter,
  });
};
// 修改员工信息
export const updateEmployeeApi = (parameter: any) => {
  return service({
    url: "/auth-admin/edit",
    method: "post",
    data: parameter,
  });
};
// 分页查询员工
export const findEmployeeApi = (parameter: any) => {
  return service({
    url: "/auth-admin/find",
    method: "post",
    data: parameter,
  });
};
// 员工密码修改
export const editPwdEmployeeApi = (parameter: any) => {
  return service({
    url: "/auth-admin/edit/pwd",
    method: "post",
    data: parameter,
  });
};
// 激活员工账号
export const activeEmployeeApi = (parameter: any) => {
  return service({
    url: "/auth-admin/batch/active",
    method: "post",
    data: parameter,
  });
};
// 删除员工账号
export const deleteEmployeeApi = (parameter: any) => {
  return service({
    url: "/auth-admin/batch/del",
    method: "post",
    data: parameter,
  });
};
///////////////////// 角色管理 //////////////////////////////////
// 添加角色
export const addRoleApi = (parameter: any) => {
  return service({
    url: "/auth-role/add",
    method: "post",
    data: parameter,
  });
};
// 修改角色(包括配置菜单权限及员工)
export const editRoleApi = (parameter: any) => {
  return service({
    url: "/auth-role/edit",
    method: "post",
    data: parameter,
  });
};
// 查询角色下的员工
export const findEmployeeByRoleIdApi = (roleId: number) => {
  return service({
    url: `/auth-role/find/admin/${roleId}`,
    method: "post",
  });
};

// 获取菜单列表
export const findMenuListApi = () => {
  return service({
    url: `/auth-menu/list`,
    method: "get",
  });
};

// 查询角色列表
export const roleFindApi = (parameter: any) => {
  return service({
    url: "/auth-role/find",
    method: "post",
    data: parameter,
  });
};
// 查询角色下的菜单列表
export const findMenuApi = (roleId: number) => {
  return service({
    url: `/auth-role/find/menu/${roleId}`,
    method: "post",
  });
};
// 批量删除角色
export const batchDelRoleApi = (parameter: any) => {
  return service({
    url: "/auth-role/batch/del",
    method: "post",
    data: parameter,
  });
};

///////////////////// vip套餐管理 //////////////////////////////////
// 添加会员套餐
export const addVipApi = (parameter: any) => {
  return service({
    url: "/pack-vip/add",
    method: "post",
    data: parameter,
  });
};
// 修改会员套餐
export const editVipApi = (parameter: any) => {
  return service({
    url: "/pack-vip/edit",
    method: "post",
    data: parameter,
  });
};
// 批量启/停用
export const batchEnableVipApi = (parameter: any) => {
  return service({
    url: `/pack-vip/batch/enable/${parameter.state}`,
    method: "post",
    data: parameter.ids,
  });
};
// 查询vip套餐列表(支持分页)
export const findVipApi = (parameter: any) => {
  return service({
    url: `/pack-vip/find`,
    method: "post",
    data: parameter,
  });
};
// 添加会员套餐返利规则
export const addBountyApi = (parameter: any) => {
  return service({
    url: "/pack-vip/add/bounty",
    method: "post",
    data: parameter,
  });
};
// 修改会员套餐返利规则
export const editBountyApi = (parameter: any) => {
  return service({
    url: "/pack-vip/edit/bounty",
    method: "post",
    data: parameter,
  });
};
// 查询会员套餐返利规则
export const findBountyApi = (vipId) => {
  return service({
    url: `/pack-vip/find/${vipId}`,
    method: "get",
  });
};
// 删除会员套餐返利规则
export const delBounty = (parameter: any) => {
  return service({
    url: "/pack-vip/del/{vip_id}",
    method: "post",
  });
};

// 添加会员套餐系列
export const addVipSeriesApi = (parameter: any) => {
  return service({
    url: "/pack-vip/series/add",
    method: "post",
    data: parameter,
  });
};
// 修改会员套餐系列
export const updateVipSeriesApi = (parameter: any) => {
  return service({
    url: "/pack-vip/series/edit",
    method: "post",
    data: parameter,
  });
};
// 获取系列列表
export const listVipSeriesApi = (parameter: any) => {
  return service({
    url: `/pack-vip/series/list/${parameter.page}/${parameter.size}`,
    method: "post",
  });
};
// 删除系列列表
export const delVipSeriesApi = (parameter: any) => {
  return service({
    url: `/pack-vip/series/del/${parameter.series_id}`,
    method: "post",
  });
};

// 获取系列简略列表
export const getSeriesListApi = () => {
  return service({
    url: `/pack-vip/series/brief/list`,
    method: "post",
  });
};

///////////////////// svip套餐管理 //////////////////////////////////
// 查询svip套餐列表
export const findSvipApi = (parameter: any) => {
  return service({
    url: `/pack-svip/find`,
    method: "post",
    data: parameter,
  });
};

// 添加svip套餐
export const addSvipApi = (parameter: any) => {
  return service({
    url: `/pack-svip/add`,
    method: "post",
    data: parameter,
  });
};

// 编辑svip套餐
export const editSvipApi = (parameter: any) => {
  return service({
    url: `/pack-svip/edit`,
    method: "post",
    data: parameter,
  });
};

// 启用/禁用svip套餐
export const batchEnableSvipApi = (parameter: any) => {
  return service({
    url: `/pack-svip/batch/enable/${parameter.state}`,
    method: "post",
    data: parameter.ids,
  });
};

///////////////////// 权益管理 //////////////////////////////////
// 查询权益列表
export const findRightsApi = (parameter: any) => {
  return service({
    url: `/pack-right/find`,
    method: "post",
    data: parameter,
  });
};

// 添加权益
export const addRightsApi = (parameter: any) => {
  return service({
    url: `/pack-right/add`,
    method: "post",
    data: parameter,
  });
};

// 修改权益
export const editRightsApi = (parameter: any) => {
  return service({
    url: `/pack-right/edit`,
    method: "post",
    data: parameter,
  });
};

// 启用/禁用权益
export const batchEnableRightsApi = (parameter: any) => {
  return service({
    url: `/pack-right/batch/enable`,
    method: "post",
    data: parameter,
  });
};
///////////////////// 车主服务 //////////////////////////////////
///////////////////// 车主页面配置 //////////////////////////////////
// 查询车主页面配置
export const findDriverIconApi = (parameter: any) => {
  return service({
    url: `/driver/icon/list`,
    method: "post",
    data: parameter,
  });
};

// 添加车主页面配置
export const addDriverIconApi = (parameter: any) => {
  return service({
    url: `/driver/icon/add`,
    method: "post",
    data: parameter,
  });
};

// 修改车主页面配置
export const editDriverIconApi = (parameter: any) => {
  return service({
    url: `/driver/icon/update`,
    method: "post",
    data: parameter,
  });
};

// 删除车主页面配置
export const delDriverIconApi = (parameter: any) => {
  return service({
    url: `/driver/icon/del`,
    method: "post",
    data: parameter,
  });
};

// 禁/启用车主页面配置
export const batchDriverIconApi = (parameter: any) => {
  return service({
    url: `/driver/icon/disable/${parameter.state}`,
    method: "post",
    data: parameter.ids,
  });
};

///////////////////// 车主服务说明 //////////////////////////////////
// 查询车主服务说明
export const findServiceNoteApi = (parameter: any) => {
  return service({
    url: `/driver/content/list`,
    method: "post",
    data: parameter,
  });
};

// 添加车主服务说明
export const addServiceNoteApi = (parameter: any) => {
  return service({
    url: `/driver/content/add`,
    method: "post",
    data: parameter,
  });
};

// 修改车主服务说明
export const editServiceNoteApi = (parameter: any) => {
  return service({
    url: `/driver/content/update`,
    method: "post",
    data: parameter,
  });
};

// 禁/启用车主服务说明
export const batchServiceNoteApi = (parameter: any) => {
  return service({
    url: `/driver/content/disable/${parameter.state}`,
    method: "post",
    data: parameter.ids,
  });
};

///////////////////// 增值业务 /////////////////////////////////////
// 查询加油订单
export const findRefuelOrderApi = (parameter: any) => {
  return service({
    url: `/order/oil/list`,
    method: "post",
    data: parameter,
  });
};

// 加油退款申请
export const refundRefuelOrderApi = (parameter: any) => {
  return service({
    url: `/refund/v2/apply/oil`,
    method: "post",
    data: parameter,
  });
};

// 查询能链加油订单详情
export const findRefuelOrderDetailApi = (orderNo) => {
  return service({
    url: `/order/nl/oil/order/detail?orderNo=${orderNo}`,
    method: "post",
  });
};

// 查询加油退款订单
export const findRefuelRefundOrderApi = (parameter: any) => {
  return service({
    url: `/order/oil/refund/list`,
    method: "post",
    data: parameter,
  });
};

// 查询洗车扣款订单
export const findWashOrderApi = (parameter: any) => {
  return service({
    url: `/order/sd/list`,
    method: "post",
    data: parameter,
  });
};

// 查询洗车扣款订单Excel数据
export const findWashExcelApi = (parameter: any) => {
  return service({
    url: `/order/sd/export`,
    method: "post",
    responseType: "blob",
    data: parameter,
  });
};

// 查询洗车退款订单
export const findRefundDetailsApi = (parameter: any) => {
  return service({
    url: `/order/sd/refundDetails`,
    method: "post",
    data: parameter,
  });
};

// 审核洗车退款订单
export const examineRefundOrderApi = (parameter: any) => {
  return service({
    url: `/refund/v2/check`,
    method: "post",
    data: parameter,
  });
};

///////////////////// 签约订单 /////////////////////////////////////
// 查询签约订单
export const findSignedOrderApi = (parameter: any) => {
  return service({
    url: `/order/sign/list`,
    method: "post",
    data: parameter,
  });
};

///////////////////// 扣款订单 /////////////////////////////////////
// 查询扣款订单
export const findDebitOrderApi = (parameter: any) => {
  return service({
    url: `/order/debit/list`,
    method: "post",
    data: parameter,
  });
};

// 查询退款历史信息
export const queryRefundApi = (orderId) => {
  return service({
    url: `/pay/refund/info?orderId=${orderId}`,
    method: "get",
  });
};

// 发起退款
export const refundApi = (parameter: any) => {
  return service({
    url: `/pay/refund`,
    method: "post",
    data: parameter,
  });
};

// 查询扣款订单Excel数据
export const findDebitExcelApi = (parameter: any) => {
  return service({
    url: `/order/debit/export`,
    method: "post",
    responseType: "blob",
    data: parameter,
  });
};

// 手动执行激活状态查询任务
export const findActiveApi = () => {
  return service({
    url: `/order/handle/active/req`,
    method: "get",
  });
};

// 激活更新
export const activateUpdateApi = (parameter: any) => {
  return service({
    url: `/order/debit/update/active`,
    method: "post",
    data: parameter,
  });
};

// 取消订单
export const cancelDebitOrderApi = (orderId) => {
  return service({
    url: `/order/cancelDebitOrder/${orderId}`,
    method: "post",
  });
};

///////////////////// 退款订单 /////////////////////////////////////
// 查询退款订单
export const findRefundApi = (parameter: any) => {
  return service({
    url: `/order/refund/list`,
    method: "post",
    data: parameter,
  });
};

// 查询退款订单Excel数据
export const findRefundExcelApi = (parameter: any) => {
  return service({
    url: `/order/refund/export`,
    method: "post",
    responseType: "blob",
    data: parameter,
  });
};

// 重新退款请求
export const againRefundApi = (refund_id: any) => {
  return service({
    url: `/pay/afresh/refund/${refund_id}`,
    method: "post",
  });
};

// 修改车牌号
export const updateCarNo = (parameter: any) => {
  return service({
    url: `/order/update/carNo/${parameter.orderId}/${parameter.newCarNo}`,
    method: "post",
  });
};

///////////////////// 通行订单 /////////////////////////////////////
// 查询通行订单
export const findPassOrderApi = (parameter: any) => {
  return service({
    url: `/order/pass/list`,
    method: "post",
    data: parameter,
  });
};

// 查询通行订单Excel数据
export const findPassExcelApi = (parameter: any) => {
  return service({
    url: `/order/pass/export`,
    method: "post",
    responseType: "blob",
    data: parameter,
  });
};

///////////////////// 奖励订单 /////////////////////////////////////
// 查询奖励订单
export const findRewarOrderApi = (parameter: any) => {
  return service({
    url: `/order/award/list`,
    method: "post",
    data: parameter,
  });
};

///////////////////// 预充金订单 /////////////////////////////////////
// 查询预充金订单
export const findPrePaymentOrderApi = (parameter: any) => {
  return service({
    url: `/order/advance_gold/list`,
    method: "post",
    data: parameter,
  });
};

// 查询预充金订单Excel数据
export const findPrePaymentExcelApi = (parameter: any) => {
  return service({
    url: `/order/preGold/export`,
    method: "post",
    responseType: "blob",
    data: parameter,
  });
};

///////////////////// 提现订单 /////////////////////////////////////
// 查询提现订单
export const findWithdrawalOrderApi = (parameter: any) => {
  return service({
    url: `/order/withdraw/list`,
    method: "post",
    data: parameter,
  });
};

// 查询提现订单Excel数据
export const findWithdrawalExcelApi = (parameter: any) => {
  return service({
    url: `/order/withdraw/export`,
    method: "post",
    responseType: "blob",
    data: parameter,
  });
};

// 提现订单审核
export const withdrawalReviewApi = (parameter: any) => {
  return service({
    url: `/check/withdraw`,
    method: "post",
    data: parameter,
  });
};

///////////////////// 业务订单 /////////////////////////////////////
// 查询业务订单
export const findBusinessOrderApi = (parameter: any) => {
  return service({
    url: `/order/business/list`,
    method: "post",
    data: parameter,
  });
};

// 获取当前销售代表(销售总监)下的一级代理信息
export const findAgentBySaleIdApi = () => {
  return service({
    url: `/order/list/agent/bySaleId`,
    method: "post",
  });
};

// 查询业务订单Excel数据
export const findBusinessExcelApi = (parameter: any) => {
  return service({
    url: `/order/business/export`,
    method: "post",
    responseType: "blob",
    data: parameter,
  });
};

///////////////////// 上传订单 /////////////////////////////////////
// 查询上传订单
export const findUploadOrderApi = (parameter: any) => {
  return service({
    url: `/pass/bill/check/list`,
    method: "post",
    data: parameter,
  });
};

// 查询上传订单统计数据
export const findTotalUploadOrderApi = (parameter: any) => {
  return service({
    url: `/pass/bill/summary/amt`,
    method: "post",
    data: parameter,
  });
};

// 查询账单操作详情信息
export const findUploadOrderByIdApi = (parameter: any) => {
  return service({
    url: `/pass/bill/bill/detail`,
    method: "post",
    data: parameter,
  });
};

// 查询上传订单Excel数据
export const findUploadExcelApi = (parameter: any) => {
  return service({
    url: `/pass/bill/export`,
    method: "post",
    responseType: "blob",
    data: parameter,
  });
};

// 上传订单审核
export const uploadReviewApi = (parameter: any) => {
  return service({
    url: `/pass/bill/bill/check`,
    method: "post",
    data: parameter,
  });
};

///////////////////// 云瞻订单 /////////////////////////////////////
// 查询云瞻订单
export const findYunZhanOrderApi = (parameter: any) => {
  return service({
    url: `/yzOrder/list`,
    method: "post",
    data: parameter,
  });
};

///////////////////// 门店报备 /////////////////////////////////////
// 查询代理审计信息
export const findStorefrontApi = (parameter: any) => {
  return service({
    url: `/agent/audit/list`,
    method: "post",
    data: parameter,
  });
};

// 审核门店信息
export const examineReviewApi = (parameter: any) => {
  return service({
    url: `/agent/audit`,
    method: "post",
    data: parameter,
  });
};

// 查询代理审计Excel数据
export const findStorefrontExcelApi = (parameter: any) => {
  return service({
    url: `/agent/audit/export`,
    method: "post",
    responseType: "blob",
    data: parameter,
  });
};

// 查询代理审计登录数据
export const findStoreAuditInfoApi = (parameter: any) => {
  return service({
    url: `/agent/audit/queryAuditInfo`,
    method: "post",
    data: parameter,
  });
};

// 向第三方报备
export const reportApplyApi = (parameter: any) => {
  return service({
    url: `/agentThirdPartyReport/reportApply`,
    method: "post",
    data: parameter,
  });
};

// 查询第三方报备列表
export const findAgentReportListApi = (parameter: any) => {
  return service({
    url: `/agentThirdPartyReport/getList`,
    method: "post",
    data: parameter,
  });
};

///////////////////// 作业监控 /////////////////////////////////////
// 查询作业监控数据
export const findJobMonitoringApi = (parameter: any) => {
  return service({
    url: `/riskControl/monitor`,
    method: "post",
    data: parameter,
  });
};

// 查询作业监控Excel数据
export const findJobMonitoringExcelApi = (parameter: any) => {
  return service({
    url: `/riskControl/monitor/export`,
    method: "post",
    responseType: "blob",
    data: parameter,
  });
};

///////////////////// 通用配置 /////////////////////////////////////
// 分页查询通用配置数据
export const findUniversalConfigApi = (parameter: any) => {
  return service({
    url: `/config/find`,
    method: "post",
    data: parameter,
  });
};

// 添加通用配置
export const addUniversalConfigApi = (parameter: any) => {
  return service({
    url: `/config/add`,
    method: "post",
    data: parameter,
  });
};

// 修改通用配置
export const editUniversalConfigApi = (parameter: any) => {
  return service({
    url: `/config/edit`,
    method: "post",
    data: parameter,
  });
};

///////////////////// 物资管理 /////////////////////////////////////
///////////////////// 申领订单 /////////////////////////////////////
// 查询申领订单
export const findSupplyOrderApi = (parameter: any) => {
  return service({
    url: `/supply/order/list`,
    method: "post",
    data: parameter,
  });
};

// 审核申领订单
export const examineSupplyOrderApi = (parameter: any) => {
  return service({
    url: `/supply/order/check`,
    method: "post",
    data: parameter,
  });
};

// 查询申领订单详情信息
export const findSupplyOrderByIdApi = (parameter: any) => {
  return service({
    url: `/supply/order/detail`,
    method: "post",
    data: parameter,
  });
};

// 获取物资备注
export const getNoteListApi = () => {
  return service({
    url: `/supply/list/note`,
    method: "post",
  });
};

// 获取物流名称列表
export const getLogisticsApi = () => {
  return service({
    url: `/supply/list/express`,
    method: "post",
  });
};

// 物资发货确认(单条)
export const deliverOrderConfirmApi = (parameter: any) => {
  return service({
    url: `/supply/deliver/confirm`,
    method: "post",
    data: parameter,
  });
};

// 物资完成发货
export const finishConfirmApi = (parameter: any) => {
  return service({
    url: `/supply/finish/confirm`,
    method: "post",
    data: parameter,
  });
};

// 查询物资申领订单Excel数据
export const findSupplyExcelApi = (parameter: any) => {
  return service({
    url: `/supply/order/export`,
    method: "post",
    responseType: "blob",
    data: parameter,
  });
};

///////////////////// 新会员订单 /////////////////////////////////////
// 查询新会员订单
export const findVipOrderApi = (parameter: any) => {
  return service({
    url: `/order/etc/debit/list`,
    method: "post",
    data: parameter,
  });
};

// 查询退款历史信息
export const queryRefundEtcApi = (mainOrderId) => {
  return service({
    url: `/order/etc/history?mainOrderId=${mainOrderId}`,
    method: "get",
  });
};

// 新会员订单退款
export const refundVipOrderApi = (parameter: any) => {
  return service({
    url: `/refund/v2/etc`,
    method: "post",
    data: parameter,
  });
};

// 查询新会员订单Excel数据
export const findVipOrderExcelApi = (parameter: any) => {
  return service({
    url: `/order/etc/debit/export`,
    method: "post",
    responseType: "blob",
    data: parameter,
  });
};

// 手动执行激活状态查询任务
export const findEtcActiveApi = () => {
  return service({
    url: `/order/etc/flush/active-state/of-day`,
    method: "post",
  });
};

// 激活更新
export const activeUpdateApi = (parameter: any) => {
  return service({
    url: `/order/etc/update/active-state`,
    method: "post",
    data: parameter,
  });
};

// 取消订单
export const cancelVipOrderApi = (mainOrderId) => {
  return service({
    url: `/order/etc/debit/cancel/${mainOrderId}`,
    method: "post",
  });
};

// 修改车牌号
export const updateCarNoApi = (parameter: any) => {
  return service({
    url: `/order/etc/update/carNo/${parameter.etcOrderId}/${parameter.newCarNo}`,
    method: "post",
  });
};

///////////////////// 新退款订单 /////////////////////////////////////
// 查询退款订单
export const findRefundNewApi = (parameter: any) => {
  return service({
    url: `/order/etc/list/refund-order`,
    method: "post",
    data: parameter,
  });
};

// 查询退款订单Excel数据
export const findRefundExcelNewApi = (parameter: any) => {
  return service({
    url: `/order/etc/refund/export`,
    method: "post",
    responseType: "blob",
    data: parameter,
  });
};

///////////////////// 跑马灯管理 /////////////////////////////////////
// 查询跑马灯列表
export const findMarqueeListApi = (parameter: any) => {
  return service({
    url: `/pub/marquee/list`,
    method: "post",
    data: parameter,
  });
};

// 查询跑马灯详情信息
export const findMarqueeInfoByIdApi = (id) => {
  return service({
    url: `/pub/marquee/detail/${id}`,
    method: "get"
  });
};

// 添加跑马灯数据
export const addMarqueeApi = (parameter: any) => {
  return service({
    url: `/pub/marquee/add`,
    method: "post",
    data: parameter,
  });
};

// 审核跑马灯
export const checkMarqueeApi = (parameter: any) => {
  return service({
    url: `/pub/marquee/check`,
    method: "post",
    data: parameter,
  });
};

// 下架跑马灯
export const offShelfMarqueeApi = (parameter: any) => {
  return service({
    url: `/pub/marquee/off-shelf`,
    method: "post",
    data: parameter,
  });
};

///////////////////// 公告管理 /////////////////////////////////////
// 查询公告列表
export const findNoticeListApi = (parameter: any) => {
  return service({
    url: `/pub/notice/list`,
    method: "post",
    data: parameter,
  });
};

// 查询公告详情信息
export const findNoticeInfoByIdApi = (id) => {
  return service({
    url: `/pub/notice/detail/${id}`,
    method: "get"
  });
};

// 添加公告数据
export const addNoticeApi = (parameter: any) => {
  return service({
    url: `/pub/notice/add`,
    method: "post",
    data: parameter,
  });
};

// 审核公告
export const checkNoticeApi = (parameter: any) => {
  return service({
    url: `/pub/notice/check`,
    method: "post",
    data: parameter,
  });
};

// 下架公告
export const offShelfNoticeApi = (parameter: any) => {
  return service({
    url: `/pub/notice/off-shelf`,
    method: "post",
    data: parameter,
  });
};

///////////////////// 广告管理 /////////////////////////////////////
// 查询广告列表
export const findADVListApi = (parameter: any) => {
  return service({
    url: `/pub/ad/list`,
    method: "post",
    data: parameter,
  });
};

// 查询广告详情信息
export const findADVInfoByIdApi = (id) => {
  return service({
    url: `/pub/ad/detail/${id}`,
    method: "get"
  });
};

// 添加广告数据
export const addADVApi = (parameter: any) => {
  return service({
    url: `/pub/ad/add`,
    method: "post",
    data: parameter,
  });
};

// 审核广告
export const checkADVApi = (parameter: any) => {
  return service({
    url: `/pub/ad/check`,
    method: "post",
    data: parameter,
  });
};

// 下架广告
export const offShelfADVApi = (parameter: any) => {
  return service({
    url: `/pub/ad/off-shelf`,
    method: "post",
    data: parameter,
  });
};

// 上传文件
export const fileUploadApi = (file: any) => {
  return service({
    url: `/file/upload/notice-pic`,
    method: "post",
    data: file,
  });
};

///////////////////// 支付配置 /////////////////////////////////////
///////////////////// 支付场景 /////////////////////////////////////
// 查询支付场景列表
export const findPaySceneListApi = (parameter: any) => {
  return service({
    url: `/paymanagement/scenario/list`,
    method: "post",
    data: parameter,
  });
};

// 添加/修改支付场景
export const editPaySceneApi = (parameter: any) => {
  return service({
    url: `/paymanagement/scenario/addAndUpdate`,
    method: "post",
    data: parameter,
  });
};

// 查询所有支付方式
export const findPaymanagement = (parameter: any) => {
  return service({
    url: "/paymanagement/method/list",
    method: "post",
    data: parameter,
  });
};

///////////////////// 关联支付场景 /////////////////////////////////////
// 查询关联支付场景列表
export const findAssnPaySceneListApi = (parameter: any) => {
  return service({
    url: `/paymanagement/product/list`,
    method: "post",
    data: parameter,
  });
};

// 添加/修改关联支付场景
export const editAssnPaySceneApi = (parameter: any) => {
  return service({
    url: `/paymanagement/product/addAndUpdate`,
    method: "post",
    data: parameter,
  });
};

// 查询支付场景列表
export const findPayMethodByIdApi = (id) => {
  return service({
    url: `/paymanagement/scenario/list/product?id=${id}`,
    method: "get",
  });
};

///////////////////// 营销系统 /////////////////////////////////////
///////////////////// 营销任务列表 /////////////////////////////////////
// 查询跑马灯列表
export const findMKTListApi = (parameter: any) => {
  return service({
    url: `/coupon/template/list`,
    method: "post",
    data: parameter,
  });
};

// 更改营销任务状态
export const checkMKTStatusApi = (parameter: any) => {
  return service({
    url: `/coupon/template/update`,
    method: "post",
    data: parameter,
  });
};

// 添加营销任务
export const addMarketTaskApi = (parameter: any) => {
  return service({
    url: `/coupon/template/add`,
    method: "post",
    data: parameter,
  });
};

// 查询营销任务详情信息
export const findMarketTasInfoByIdApi = (id) => {
  return service({
    url: `/coupon/template/detail?id=${id}`,
    method: "post",
  });
};

// 审核营销任务
export const checkMarketTasApi = (parameter: any) => {
  return service({
    url: `/coupon/template/update`,
    method: "post",
    data: parameter,
  });
};

///////////////////// 优惠券列表 /////////////////////////////////////
// 查询跑马灯列表
export const findCouponListApi = (parameter: any) => {
  return service({
    url: `/coupon/user/list`,
    method: "post",
    data: parameter,
  });
};

// 更改优惠券状态
export const checkCouponStatusApi = (parameter: any) => {
  return service({
    url: `/coupon/user/updateStatus`,
    method: "post",
    data: parameter,
  });
};

// 查询优惠券Excel数据
export const findCouponExcelApi = (parameter: any) => {
  return service({
    url: `/coupon/user/list/export`,
    method: "post",
    responseType: "blob",
    data: parameter,
  });
};